<%@ page contentType="text/html; charset=utf-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>

        <title>修改公告</title>
        <script type="text/javascript"   src="${pageContext.request.contextPath}/js/DatePicker/WdatePicker.js"></script>
        <link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet" type="text/css">
        <script type="text/javascript">
	
            function checkForm(){
                var title= document.getElementById("notice.title").value;
                var content = document.getElementById("editor").value;
                var time = document.getElementById("notice.createTime").value;
                if(!title){
                    alert('标题不能为空!');
                    return false;
                }
                if(!content){
                    alert('公告内容不能为空!');
                    return false;
                }
                if(!time)
                {
                    alert("请选择发布时间！");
                    return false;
                }
                return true;
            }	
        </script>
        
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/kindeditor/kindeditor3.5.6.js" charset="UTF-8"></script>
        <script type="text/javascript">
            KE.show({
                id : "editor",
                width : "800px",
                height : "600px",		    
                resizeMode : 1,
                allowFileManager : true,
                syncType : "auto",
                /*图片上传的SERVLET路径*/
                imageUploadJson: "${pageContext.request.contextPath}/keplugin/KEUploadImg.servlet",
                fileManagerJson : "${pageContext.request.contextPath}/keplugin/KEManageImages.servlet",
                //缺省为 *.*表示所有类型文件
                //accessoryTypes: "doc|docx",
                accessoryUploadJson: "${pageContext.request.contextPath}/keplugin/KEUploadAttach.servlet"   
            });
        </script>        

    </head>
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
        <table cellspacing=0 cellpadding=0 border=0 width="100%">
            <tr>
                <td width="1%" height="22" align="center"
                    background="${pageContext.request.contextPath}/images/main20100521_582.gif"
                    style="color: #FFFFFF; font-weight: bold; padding-left: 5px; padding-right: 5px;"><img src="${pageContext.request.contextPath}/images/modpass.gif" width="16" height="16"></td>
                <td width="99%" background="../images/main20100521_582.gif" style="color: #FFFFFF; font-weight: bold;">修改公告</td>
            </tr>
        </table>
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
            <s:form id="form" name="form" action="updateSystemNotice.action" method="post" theme="simple" namespace="/systemnotice">
                <s:hidden id="notice.id" name="notice.id"></s:hidden>            
                <tr>
                    <td bgcolor="white" valign="top">
                        <table width="99%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#b5d6e6">
                            <tr>
                                <td width="5%" align="right" bgcolor="#deebf1" class="zczb_qua">标 题：</td>
                                <td width="35%" bgcolor="#FFFFFF">
                                    <input id="notice.title" name="notice.title" value="<s:property value='notice.title'/>" type="text" size="50" style="width: 80%;"/>
                                </td>
                            </tr>
                            <tr>
                                <td width="5%" align="right" bgcolor="#deebf1" class="zczb_qua">类型：</td>
                                <td width="35%" bgcolor="#FFFFFF">
                                    <select name="notice.type" id="notice.type">
                                        <s:if test="notice.type=='1'" >
                                             <option value =1 selected>最新公告</option>
                                              <option value =2>资讯</option>   
                                        </s:if>
                                          <s:else >
                                         <option value =1>最新公告</option>
                                         <option value =2 selected>资讯</option>  
                                          </s:else >
                                     </select>

                                </td>
                            </tr>
                            <tr>
                                <td width="5%" align="right" bgcolor="#deebf1" class="zczb_qua">发布人：</td>
                                <td width="20%" bgcolor="#FFFFFF">
                                    <input type="text" id="notice.authorName" name="notice.authorName" value="<s:property value='notice.authorName'/>" size="70" style="width: 80%;" />
                                </td>
                            </tr>

                            <tr>
                                <td width="5%" align="right" bgcolor="#deebf1" class="zczb_qua">公告内容：</td>
                                <td width="35%" bgcolor="#FFFFFF">
                                    <textarea name="notice.conten" id="editor" rows="10" cols="90" style="width: 90%; height:120;"><s:property value='notice.conten'/>
                                    </textarea></td>
                            </tr>

                            <tr>
                                <td width="5%" align="right" bgcolor="#deebf1" class="zczb_qua">发布时间：</td>
                                <td width="10%" bgcolor="#FFFFFF">  
                                <input id="notice.createTime" name="notice.createTime"
                                             onclick="WdatePicker()" cssClass="Wdate" 
                                             onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" 
                                             value= " <s:date name="notice.createTime" format="yyyy-MM-dd HH:mm:ss"/>" style="width:40%"/>
                                </td>
                            </tr>

                            <tr align="center" style="height:25">
                                <td height="30" colspan="2" align="center" nowrap="nowrap" bgcolor="#FFFFFF">
                                    <input name="submit" type="submit" value="发送通知" class="mmBtn" onClick="javascript:return checkForm();">&nbsp;&nbsp;
                                  
                                    <input name="button" type="button" value="后退" onClick="javascript:window.location.href='${pageContext.request.contextPath}/systemnotice/findlist.action'" class="mmBtn">
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </s:form>
        </table>
    </body>
</html>